﻿namespace Probel.PersonalNotes.Models
{
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;

    using Microsoft.AspNet.Identity;
    using Microsoft.Owin.Security;

    public class AddPhoneNumberViewModel
    {
        #region Properties

        [Required]
        [Phone]
        [Display(Name = "Phone Number")]
        public string Number
        {
            get; set;
        }

        #endregion Properties
    }

    public class ChangePasswordViewModel
    {
        #region Properties

        [DataType(DataType.Password)]
        [Display(Name = "Confirm new password")]
        [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
        public string ConfirmPassword
        {
            get; set;
        }

        [Required]
        [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
        [DataType(DataType.Password)]
        [Display(Name = "New password")]
        public string NewPassword
        {
            get; set;
        }

        [Required]
        [DataType(DataType.Password)]
        [Display(Name = "Current password")]
        public string OldPassword
        {
            get; set;
        }

        #endregion Properties
    }

    public class ConfigureTwoFactorViewModel
    {
        #region Properties

        public ICollection<System.Web.Mvc.SelectListItem> Providers
        {
            get; set;
        }

        public string SelectedProvider
        {
            get; set;
        }

        #endregion Properties
    }

    public class FactorViewModel
    {
        #region Properties

        public string Purpose
        {
            get; set;
        }

        #endregion Properties
    }

    public class IndexViewModel
    {
        #region Properties

        public bool BrowserRemembered
        {
            get; set;
        }

        public bool HasPassword
        {
            get; set;
        }

        public IList<UserLoginInfo> Logins
        {
            get; set;
        }

        public string PhoneNumber
        {
            get; set;
        }

        public bool TwoFactor
        {
            get; set;
        }

        #endregion Properties
    }

    public class ManageLoginsViewModel
    {
        #region Properties

        public IList<UserLoginInfo> CurrentLogins
        {
            get; set;
        }

        public IList<AuthenticationDescription> OtherLogins
        {
            get; set;
        }

        #endregion Properties
    }

    public class SetPasswordViewModel
    {
        #region Properties

        [DataType(DataType.Password)]
        [Display(Name = "Confirm new password")]
        [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
        public string ConfirmPassword
        {
            get; set;
        }

        [Required]
        [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
        [DataType(DataType.Password)]
        [Display(Name = "New password")]
        public string NewPassword
        {
            get; set;
        }

        #endregion Properties
    }

    public class VerifyPhoneNumberViewModel
    {
        #region Properties

        [Required]
        [Display(Name = "Code")]
        public string Code
        {
            get; set;
        }

        [Required]
        [Phone]
        [Display(Name = "Phone Number")]
        public string PhoneNumber
        {
            get; set;
        }

        #endregion Properties
    }
}